<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="referrer" content="no-referrer-when-downgrade">
    

    <title>Python利器pandas | 早起的年轻人</title>
    <meta property="og:title" content="Python利器pandas - 早起的年轻人">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content='2021-09-05T12:20:16&#43;08:00'>
        
        
    <meta property="article:modified_time" content='2021-09-05T12:20:16&#43;08:00'>
        
    <meta name="Keywords" content="Flutter，golang,go语言,go语言笔记,飞雪无情,java,android,博客,项目管理,python,软件架构,公众号,小程序">
    <meta name="description" content="Python利器pandas">
        
    <meta name="author" content="luckly">
    <meta property="og:url" content="https://luckly.work/post/python/python%E5%88%A9%E5%99%A8pandas/">
    <link rel="shortcut icon" href='/favicon.ico'  type="image/x-icon">

    <link rel="stylesheet" href='/css/normalize.css'>
    <link rel="stylesheet" href='/css/style.css'>
    <script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    
    
    
        <link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" rel="stylesheet">
    
    
    
    
        <link rel="stylesheet" href='/css/douban.css'>
    
        <link rel="stylesheet" href='/css/other.css'>
    
</head>

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
<body>
    <header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="https://luckly.work/">
                        早起的年轻人
                    </a>
                
                <p class="description">专注于Flutter、Android、Java、Go语言(golang)、移动互联网、项目管理、软件架构</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="current" href="https://luckly.work/">首页</a>
                    
                    <a  href="https://luckly.work/categories/" title="分类">分类</a>
                    
                    <a  href="https://luckly.work/tags/" title="标签">标签</a>
                    
                    <a  href="https://luckly.work/archives/" title="归档">归档</a>
                    
                    <a  href="https://luckly.work/about/" title="关于我">关于我</a>
                    
                    <a  href="https://github.com/ITmxs/" title="github">github</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>

    <div id="body">
        <div class="container">
            <div class="col-group">

                <div class="col-8" id="main">
                    
<div class="res-cons">
    <style type="text/css">
    .post-toc {
        position: fixed;
        width: 200px;
        margin-left: -210px;
        padding: 5px 10px;
        font-family: Athelas, STHeiti, Microsoft Yahei, serif;
        font-size: 12px;
        border: 1px solid rgba(0, 0, 0, .07);
        border-radius: 5px;
        background-color: rgba(255, 255, 255, 0.98);
        background-clip: padding-box;
        -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        word-wrap: break-word;
        white-space: nowrap;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        z-index: 999;
        cursor: pointer;
        max-height: 70%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .post-toc .post-toc-title {
        width: 100%;
        margin: 0 auto;
        font-size: 20px;
        font-weight: 400;
        text-transform: uppercase;
        text-align: center;
    }

    .post-toc .post-toc-content {
        font-size: 15px;
    }

    .post-toc .post-toc-content>nav>ul {
        margin: 10px 0;
    }

    .post-toc .post-toc-content ul {
        padding-left: 20px;
        list-style: square;
        margin: 0.5em;
        line-height: 1.8em;
    }

    .post-toc .post-toc-content ul ul {
        padding-left: 15px;
        display: none;
    }

    @media print,
    screen and (max-width:1057px) {
        .post-toc {
            display: none;
        }
    }
</style>
<div class="post-toc" style="position: absolute; top: 188px;">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
        <nav id="TableOfContents"></nav>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var postToc = $(".post-toc");
        if (postToc.length) {
            var leftPos = $("#main").offset().left;
            if(leftPos<220){
                postToc.css({"width":leftPos-10,"margin-left":(0-leftPos)})
            }

            var t = postToc.offset().top - 20,
                a = {
                    start: {
                        position: "absolute",
                        top: t
                    },
                    process: {
                        position: "fixed",
                        top: 20
                    },
                };
            $(window).scroll(function () {
                var e = $(window).scrollTop();
                e < t ? postToc.css(a.start) : postToc.css(a.process)
            })
        }
    })
</script>
    <article class="post">
        <header>
            <h1 class="post-title">Python利器pandas</h1>
        </header>
        <date class="post-meta meta-date">
            2021年9月5日
        </date>
        
        <div class="post-meta">
            <span>|</span>
            
            <span class="meta-category"><a href='/categories/flutter'>flutter</a></span>
            
        </div>
        
        
        <div class="post-meta">
            <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span>
                    阅读</span></span>
        </div>
        
        
        <div class="post-content">
            <blockquote>
<p>本文带大家入门Pandas，将介绍Python语言、Python数据生态和Pandas的一些基本功能。</p>
</blockquote>
<h1 id="pandas的使用人群"><strong>Pandas的使用人群</strong></h1>
<p>Pandas对数据的处理是为数据分析服务的，它所提供的各种数据处理方法、工具是基于数理统计学的，包含了日常应用中的众多数据分析方法。我们学习它不仅要掌控它的相应技术，还要从它的数据处理思路中学习数据分析的理论和方法。</p>
<p>特别地，如果你想要成为数据分析师、数据产品经理、数据开发工程师等与数据相关的工作者，学习Pandas能让你深入数据理论和实践，更好地理解和应用数据。</p>
<p>Pandas可以轻松应对白领们日常工作中的各种表格数据处理需求，还应用在金融、统计、数理研究、物理计算、社会科学、工程等领域。</p>
<p>Pandas可以实现复杂的处理逻辑，这些往往是Excel等工具无法完成的，还可以自动化、批量化，免去我们在处理相同的大量数据时的重复工作。</p>
<p>Pandas可以实现非常震撼的可视化效果，它对接众多令人赏心悦目的可视化库，可以实现动态数据交互效果。</p>
<h1 id="pandas的基本功能"><strong>Pandas的基本功能</strong></h1>
<p>Pandas常用的基本功能如下：</p>
<ul>
<li>从Excel、CSV、网页、SQL、剪贴板等文件或工具中读取数据；</li>
<li>合并多个文件或者电子表格中的数据，将数据拆分为独立文件；</li>
<li>数据清洗，如去重、处理缺失值、填充默认值、补全格式、处理极端值等；</li>
<li>建立高效的索引；</li>
<li>支持大体量数据；</li>
<li>按一定业务逻辑插入计算后的列、删除列；</li>
<li>灵活方便的数据查询、筛选；</li>
<li>分组聚合数据，可独立指定分组后的各字段计算方式；</li>
<li>数据的转置，如行转列、列转行变更处理；</li>
<li>连接数据库，直接用SQL查询数据并进行处理；</li>
<li>对时序数据进行分组采样，如按季、按月、按工作小时，也可以自定义周期，如工作日；</li>
<li>窗口计算，移动窗口统计、日期移动等；</li>
<li>灵活的可视化图表输出，支持所有的统计图形；</li>
<li>为数据表格增加展示样式，提高数据识别效率。</li>
</ul>
<h1 id="pandas快速入门"><strong>Pandas快速入门</strong></h1>
<p><strong>1、安装导入</strong></p>
<p>首先安装pandas库。打开“终端”并执行以下命令：</p>
<pre><code>pip install pandas matplotlib

# 如网络慢，可指定国内源快速下载安装

pip install pandas matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
</code></pre><p>安装完成后，在终端中启动Jupyter Notebook，给文件命名，如pandas-01。在Jupyter Notebook中导入Pandas，按惯例起别名pd：</p>
<pre><code># 引入 Pandas库，按惯例起别名pd

import pandas as pd
</code></pre><p>这样，我们就可以使用pd调用Pandas的所有功能了。</p>
<p><strong>2、准备数据集</strong></p>
<p>数据集(Data set或dataset)，又称为资料集、数据集合或资料集合，是一种由数据组成的集合，可以简单理解成一个Excel表格。在分析处理数据时，我们要先了解数据集。对所持有数据各字段业务意义的理解是分析数据的前提。</p>
<p>介绍下我们后面会经常用的数据集team.xlsx，可以从网址 <a href="https://www.gairuo.com/file/data/dataset/team.xlsx">https://www.gairuo.com/file/data/dataset/team.xlsx</a>下载。它的内容见表1。</p>
<p>表1 team.xlsx的部分内容</p>
<p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfcOQDljdmHh9YngYeTIHmQZ31tdlsKXkSNBljOuC42axEpkWD6MXIpg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfcOQDljdmHh9YngYeTIHmQZ31tdlsKXkSNBljOuC42axEpkWD6MXIpg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>这是一个学生各季度成绩总表(节选)，各列说明如下。</p>
<ul>
<li>name：学生的姓名，这列没有重复值，一个学生一行，即一条数据，共100条。</li>
<li>team：所在的团队、班级，这个数据会重复。</li>
<li>Q1～Q4：各个季度的成绩，可能会有重复值。</li>
</ul>
<p><strong>3、读取数据</strong></p>
<p>了解了数据集的意义后，我们将数据读取到Pandas里，变量名用df(DataFrame的缩写，后续会介绍)，它是Pandas二维数据的基础结构。</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python"><span style="color:#f92672">import</span> pandas <span style="color:#f92672">as</span> pd <span style="color:#75715e"># 引入Pandas库，按惯例起别名pd</span>

<span style="color:#75715e"># 以下两种效果一样，如果是网址，它会自动将数据下载到内存</span>

df <span style="color:#f92672">=</span> pd<span style="color:#f92672">.</span>read_excel(<span style="color:#e6db74">&#39;https://www.gairuo.com/file/data/dataset/team.xlsx&#39;</span>)

df <span style="color:#f92672">=</span> pd<span style="color:#f92672">.</span>read_excel(<span style="color:#e6db74">&#39;team.xlsx&#39;</span>) <span style="color:#75715e"># 文件在notebook文件同一目录下</span>

<span style="color:#75715e"># 如果是CSV，使用pd.read_csv()，还支持很多类型的数据读取</span>
</code></pre></div><p>这样就把数据读取到变量df中，输入df看一下内容，在Jupyter Notebook中的执行效果如图2所示。</p>
<p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf2Xkr7abS7zXcFzkOgiag83g3ibl7yBNBTRuVk9Yw17UyqAx8Lwyr7rlQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf2Xkr7abS7zXcFzkOgiag83g3ibl7yBNBTRuVk9Yw17UyqAx8Lwyr7rlQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图2　读取数据的执行效果</p>
<p>其中：</p>
<ul>
<li>
<p>自动增加了第一列，是Pandas为数据增加的索引，从0开始，程序不知道我们真正的业务索引，往往需要后面重新指定，使它有一定的业务意义；</p>
</li>
<li>
<p>由于数据量大，自动隐藏了中间部分，只显示前后5条；</p>
</li>
<li>
<p>底部显示了行数和列数。</p>
</li>
</ul>
<p><strong>4、查看数据</strong></p>
<p>读取完数据后我们来查看一下数据：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python">df<span style="color:#f92672">.</span>head() <span style="color:#75715e"># 查看前5条，括号里可以写明你想看的条数</span>

df<span style="color:#f92672">.</span>tail() <span style="color:#75715e"># 查看尾部5条</span>

df<span style="color:#f92672">.</span>sample(<span style="color:#ae81ff">5</span>) <span style="color:#75715e"># 随机查看5条</span>
</code></pre></div><p>查看前5条时的结果如图3所示。</p>
<p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfIdGYx6NCmSpS21r7HBZiaFSyByuddHGfKEaXHJm2Fj8YaLHnOMBxiadg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfIdGYx6NCmSpS21r7HBZiaFSyByuddHGfKEaXHJm2Fj8YaLHnOMBxiadg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图3　查看df前5条数据</p>
<p><strong>5、验证数据</strong></p>
<p>拿到数据，我们还需要验证一下数据是否加载正确，数据大小是否正常。下面是一些常用的代码，可以执行看看效果(一次执行一行)：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python">df<span style="color:#f92672">.</span>shape <span style="color:#75715e"># (100, 6) 查看行数和列数</span>

df<span style="color:#f92672">.</span>info() <span style="color:#75715e"># 查看索引、数据类型和内存信息</span>

df<span style="color:#f92672">.</span>describe() <span style="color:#75715e"># 查看数值型列的汇总统计</span>

df<span style="color:#f92672">.</span>dtypes <span style="color:#75715e"># 查看各字段类型</span>

df<span style="color:#f92672">.</span>axes <span style="color:#75715e"># 显示数据行和列名</span>

df<span style="color:#f92672">.</span>columns <span style="color:#75715e"># 列名</span>
</code></pre></div><p>df.info()显示有数据类型、索引情况、行列数、各字段数据类型、内存占用等：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python">df<span style="color:#f92672">.</span>info()

<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">class</span> <span style="color:#960050;background-color:#1e0010">&#39;</span><span style="color:#a6e22e">pandas</span><span style="color:#f92672">.</span>core<span style="color:#f92672">.</span>frame<span style="color:#f92672">.</span>DataFrame<span style="color:#e6db74">&#39;&gt;</span>

RangeIndex: <span style="color:#ae81ff">100</span> entries, <span style="color:#ae81ff">0</span> to <span style="color:#ae81ff">99</span>

Data columns (total <span style="color:#ae81ff">6</span> columns):

 <span style="color:#75715e">#   Column  Non-Null Count  Dtype</span>

<span style="color:#f92672">---</span>  <span style="color:#f92672">------</span>  <span style="color:#f92672">--------------</span>  <span style="color:#f92672">-----</span>

 <span style="color:#ae81ff">0</span>   name    <span style="color:#ae81ff">100</span> non<span style="color:#f92672">-</span>null    object

 <span style="color:#ae81ff">1</span>   team    <span style="color:#ae81ff">100</span> non<span style="color:#f92672">-</span>null    object

 <span style="color:#ae81ff">2</span>   Q1      <span style="color:#ae81ff">100</span> non<span style="color:#f92672">-</span>null    int64

 <span style="color:#ae81ff">3</span>   Q2      <span style="color:#ae81ff">100</span> non<span style="color:#f92672">-</span>null    int64

 <span style="color:#ae81ff">4</span>   Q3      <span style="color:#ae81ff">100</span> non<span style="color:#f92672">-</span>null    int64

 <span style="color:#ae81ff">5</span>   Q4      <span style="color:#ae81ff">100</span> non<span style="color:#f92672">-</span>null    int64

dtypes: int64(<span style="color:#ae81ff">4</span>), object(<span style="color:#ae81ff">2</span>)

memory usage: <span style="color:#ae81ff">4.8</span><span style="color:#f92672">+</span> KB
</code></pre></div><p>df.describe()会计算出各数字字段的总数(count)、平均数(mean)、标准差(std)、最小值(min)、四分位数和最大值(max)：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python">Out:

               Q1          Q2          Q3          Q4

count  <span style="color:#ae81ff">100.000000</span>  <span style="color:#ae81ff">100.000000</span>  <span style="color:#ae81ff">100.000000</span>  <span style="color:#ae81ff">100.000000</span>

mean    <span style="color:#ae81ff">49.200000</span>   <span style="color:#ae81ff">52.550000</span>   <span style="color:#ae81ff">52.670000</span>   <span style="color:#ae81ff">52.780000</span>

std     <span style="color:#ae81ff">29.962603</span>   <span style="color:#ae81ff">29.845181</span>   <span style="color:#ae81ff">26.543677</span>   <span style="color:#ae81ff">27.818524</span>

min      <span style="color:#ae81ff">1.000000</span>    <span style="color:#ae81ff">1.000000</span>    <span style="color:#ae81ff">1.000000</span>    <span style="color:#ae81ff">2.000000</span>

<span style="color:#ae81ff">25</span><span style="color:#f92672">%</span>     <span style="color:#ae81ff">19.500000</span>   <span style="color:#ae81ff">26.750000</span>   <span style="color:#ae81ff">29.500000</span>   <span style="color:#ae81ff">29.500000</span>

<span style="color:#ae81ff">50</span><span style="color:#f92672">%</span>     <span style="color:#ae81ff">51.500000</span>   <span style="color:#ae81ff">49.500000</span>   <span style="color:#ae81ff">55.000000</span>   <span style="color:#ae81ff">53.000000</span>

<span style="color:#ae81ff">75</span><span style="color:#f92672">%</span>     <span style="color:#ae81ff">74.250000</span>   <span style="color:#ae81ff">77.750000</span>   <span style="color:#ae81ff">76.250000</span>   <span style="color:#ae81ff">75.250000</span>

max     <span style="color:#ae81ff">98.000000</span>   <span style="color:#ae81ff">99.000000</span>   <span style="color:#ae81ff">99.000000</span>   <span style="color:#ae81ff">99.000000</span>
</code></pre></div><p><strong>6、建立索引</strong></p>
<p>以上数据真正业务意义上的索引是name列，所以我们需要使它成为索引：</p>
<pre><code>df.set_index('name', inplace=True) # 建立索引并生效
</code></pre><p>其中可选参数inplace=True会将指定好索引的数据再赋值给df使索引生效，否则索引不会生效。注意，这里并没有修改原Excel，从我们读取数据后就已经和它没有关系了，我们处理的是内存中的df变量。</p>
<p>将name建立索引后，就没有从0开始的数字索引了，如图4所示。</p>
<p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfFkE3d4DzG05LGnxQTotCC6Sf8muJ0J2NEr9A9eXnb88NfE5fUUyacQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfFkE3d4DzG05LGnxQTotCC6Sf8muJ0J2NEr9A9eXnb88NfE5fUUyacQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图4　将name设置为索引的执行效果</p>
<p><em><strong>*7、数据选取*</strong></em></p>
<p>接下来，我们像Excel那样，对数据做一些筛选操作。</p>
<p><strong>(1)选择列</strong></p>
<p>选择列的方法如下：</p>
<pre><code># 查看指定列

df['Q1']

df.Q1 # 同上，如果列名符合Python变量名要求，可使用
</code></pre><p>显示如下内容：</p>
<pre><code>df.Q1

Out:

0     89

1     36

2     57

3     93

4     65

      ..

95    48

96    21

97    98

98    11

99    21

Name: Q1, Length: 100, dtype: int64
</code></pre><p>这里返回的是一个Series类型数据，可以理解为数列，它也是带索引的。之前建立的索引在这里发挥出了作用，否则我们的索引是一个数字，无法知道与之对应的是谁的数据。</p>
<p>选择多列的可以用以下方法：</p>
<pre><code># 选择多列

df[['team', 'Q1']] # 只看这两列，注意括号

df.loc[:, ['team', 'Q1']] # 和上一行效果一样
</code></pre><p>df.loc[x, y]是一个非常强大的数据选择函数，其中x代表行，y代表列，行和列都支持条件表达式，也支持类似列表那样的切片(如果要用自然索引，需要用df.iloc[])。下面的例子中会进行演示。</p>
<p><strong>(2)选择行</strong></p>
<p>选择行的方法如下：</p>
<pre><code># 用指定索引选取

df[df.index == 'Liver'] # 指定姓名



# 用自然索引选择，类似列表的切片

df[0:3] # 取前三行

df[0:10:2] # 在前10个中每两个取一个

df.iloc[:10,:] # 前10个
</code></pre><p><strong>(3)指定行和列</strong></p>
<p>同时给定行和列的显示范围：</p>
<pre><code>df.loc['Ben', 'Q1':'Q4'] # 只看Ben的四个季度成绩

df.loc['Eorge':'Alexander', 'team':'Q4'] # 指定行区间
</code></pre><p><strong>(4)条件选择</strong></p>
<p>按一定的条件显示数据：</p>
<pre><code># 单一条件

df[df.Q1 &gt; 90] # Q1列大于90的

df[df.team == 'C'] # team列为'C'的

df[df.index == 'Oscar'] # 指定索引即原数据中的name



# 组合条件

df[(df['Q1'] &gt; 90) &amp; (df['team'] == 'C')] # and关系

df[df['team'] == 'C'].loc[df.Q1&gt;90] # 多重筛选
</code></pre><p><em><strong>*8、排序*</strong></em></p>
<p>Pandas的排序非常方便，示例如下：</p>
<pre><code>df.sort_values(by='Q1') # 按Q1列数据升序排列

df.sort_values(by='Q1', ascending=False) # 降序



df.sort_values(['team', 'Q1'], ascending=[True, False]) # team升序，Q1降序
</code></pre><p><em><strong>*9、分组聚合*</strong></em></p>
<p><em><strong>*
*</strong></em></p>
<p>我们可以实现类似SQL的groupby那样的数据透视功能：</p>
<pre><code>df.groupby('team').sum() # 按团队分组对应列相加

df.groupby('team').mean() # 按团队分组对应列求平均

# 不同列不同的计算方法

df.groupby('team').agg({'Q1': sum,  # 总和

                        'Q2': 'count', # 总数

                        'Q3':'mean', # 平均

                        'Q4': max}) # 最大值
</code></pre><p>统一聚合执行后的效果如图5所示。</p>
<p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf8gLwPxka57IbpewLLicDoSIc8q5Gy3S6ZMEx8bNhFU2uMyv7m9Tgumw/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf8gLwPxka57IbpewLLicDoSIc8q5Gy3S6ZMEx8bNhFU2uMyv7m9Tgumw/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图5　按team分组后求平均数</p>
<p>不同计算方法聚合执行后的效果如图6所示。</p>
<p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfDNxg6KGTwdCZTmwgib4y9WqXu5o0IMiceEPibvSWIkynPuMpvkH2K8FSA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfDNxg6KGTwdCZTmwgib4y9WqXu5o0IMiceEPibvSWIkynPuMpvkH2K8FSA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图6　分组后每列用不同的方法聚合计算</p>
<p><em><strong>*10、数据转换*</strong></em></p>
<p>对数据表进行转置，对类似图6中的数据以A-Q1、E-Q4两点连成的折线为轴对数据进行翻转，效果如图7所示，不过我们这里仅用sum聚合。</p>
<pre><code>df.groupby('team').sum().T
</code></pre><p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf1Pibap2icKYVpRawtP97ibRc0RycgTxEzSgRLewkiadYCmUoOHRtBgDFzQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf1Pibap2icKYVpRawtP97ibRc0RycgTxEzSgRLewkiadYCmUoOHRtBgDFzQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图7　对聚合后的数据进行翻转</p>
<p>也可以试试以下代码，看有什么效果：</p>
<pre><code>df.groupby('team').sum().stack()

df.groupby('team').sum().unstack()
</code></pre><p><em><strong>*11、增加列*</strong></em></p>
<p><em><strong>*
*</strong></em></p>
<p>用Pandas增加一列非常方便，就与新定义一个字典的键值一样。</p>
<pre><code>df['one'] = 1 # 增加一个固定值的列

df['total'] = df.Q1 + df.Q2 + df.Q3 + df.Q4 # 增加总成绩列

# 将计算得来的结果赋值给新列

df['total'] = df.loc[:,'Q1':'Q4'].apply(lambda x:sum(x), axis=1)

df['total'] = df.sum(axis=1) # 可以把所有为数字的列相加

df['avg'] = df.total/4 # 增加平均成绩列
</code></pre><p><strong>12、统计分析</strong></p>
<p>根据你的数据分析目标，试着使用以下函数，看看能得到什么结论。</p>
<pre><code>df.mean() # 返回所有列的均值

df.mean(1) # 返回所有行的均值，下同

df.corr() # 返回列与列之间的相关系数

df.count() # 返回每一列中的非空值的个数

df.max() # 返回每一列的最大值

df.min() # 返回每一列的最小值

df.median() # 返回每一列的中位数

df.std() # 返回每一列的标准差

df.var() # 方差

s.mode() # 众数
</code></pre><p><strong>13、绘图</strong></p>
<p>**
**</p>
<p>Pandas利用plot()调用Matplotlib快速绘制出数据可视化图形。注意，第一次使用plot()时可能需要执行两次才能显示图形。如图8所示，可以使用plot()快速绘制折线图。</p>
<pre><code>df['Q1'].plot() # Q1成绩的折线分布
</code></pre><p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfvgexFsnsrGvg60umcicR6dg3Gvl2OZOGdR9yv8Df1shvE3ZSicDVv3jQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfvgexFsnsrGvg60umcicR6dg3Gvl2OZOGdR9yv8Df1shvE3ZSicDVv3jQ/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图8　利用plot()快速绘制折线图</p>
<p>如图9所示，可以先选择要展示的数据，再绘图。</p>
<pre><code>df.loc['Ben','Q1':'Q4'].plot() # ben四个季度的成绩变化
</code></pre><p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfMW3OBVrd9LnLeQgatRSCc1bHgdwsqlasINibJrHL0Mcdmd3Q9rpkaPg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfMW3OBVrd9LnLeQgatRSCc1bHgdwsqlasINibJrHL0Mcdmd3Q9rpkaPg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图9　选择部分数据绘制折线图</p>
<p>如图10所示，可以使用plot.bar绘制柱状图。</p>
<pre><code>df.loc[ 'Ben','Q1':'Q4'].plot.bar() # 柱状图

df.loc[ 'Ben','Q1':'Q4'].plot.barh() # 横向柱状图
</code></pre><p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf5PyReAKmWwHGoRxtlT4YJibGhGzMMXbZo2vl1zJ9BiaWXGsibdyIvWPkA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf5PyReAKmWwHGoRxtlT4YJibGhGzMMXbZo2vl1zJ9BiaWXGsibdyIvWPkA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图10　利用plot.bar绘制的柱状图</p>
<p>如果想绘制横向柱状图，可以将bar更换为barh，如图11所示。</p>
<p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf6z6jBZj1CslckTBhZJghKiaWZnYexNaNm2q2ibKdEc6oLmP5OibNp5ibzA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf6z6jBZj1CslckTBhZJghKiaWZnYexNaNm2q2ibKdEc6oLmP5OibNp5ibzA/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图11　利用barh绘制的横向柱状图</p>
<p>对数据聚合计算后，可以绘制成多条折线图，如图12所示。</p>
<pre><code># 各Team四个季度总成绩趋势

df.groupby('team').sum().T.plot()
</code></pre><p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf0xJLmfb2HAJSCh7kU0ojgl0CwgHCQichiaIoI0k6Wm1B9sRKwmsIX9ng/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGf0xJLmfb2HAJSCh7kU0ojgl0CwgHCQichiaIoI0k6Wm1B9sRKwmsIX9ng/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图12　多条折线图</p>
<p>也可以用pie绘制饼图，如图13所示。</p>
<pre><code># 各组人数对比

df.groupby('team').count().Q1.plot.pie()
</code></pre><p>
        <a data-fancybox="gallery" href="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfEK0XBV6cIAA9qaibvHjUkPkQC2ibhSXBiaI3YqFV67ruPXeYX2XUutxtg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1">
            <img class="mx-auto" alt="图片" src="https://mmbiz.qpic.cn/mmbiz_png/oeqMOybW2r1eqYhXj0OMFf7bKwBaCfGfEK0XBV6cIAA9qaibvHjUkPkQC2ibhSXBiaI3YqFV67ruPXeYX2XUutxtg/640?wx_fmt=png&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" />
        </a>
    </p>
<p>图13　饼图的绘制效果</p>
<p><strong>14、导出</strong></p>
<p>**
**</p>
<p>可以非常轻松地导出Excel和CSV文件。</p>
<pre><code>df.to_excel('team-done.xlsx') # 导出 Excel文件

df.to_csv('team-done.csv') # 导出 CSV文件
</code></pre><p>导出的文件位于notebook文件的同一目录下，打开看看。</p>
<p>本文我们了解了编程语言Python的特点，为什么要学Python，Pandas库的功能，快速感受了一下Pandas强大的数据处理和数据分析能力。这些是我们进入数据科学领域的基础。</p>
        </div>

        
<div class="post-archive">
    <ul class="post-copyright">
        <li><strong>原文作者：</strong><a rel="author" href="https://luckly.work/">luckly</a></li>
        <li style="word-break:break-all"><strong>原文链接：</strong><a href="https://luckly.work/post/python/python%E5%88%A9%E5%99%A8pandas/">https://luckly.work/post/python/python%E5%88%A9%E5%99%A8pandas/</a></li>
        <li><strong>版权声明：</strong>本作品采用<a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议</a>进行许可，非商业转载请注明出处（作者，原文链接），商业转载请联系作者获得授权。</li>
    </ul>
</div>
<br/>



        

<div class="post-archive">
    <h2>See Also</h2>
    <ul class="listing">
        
        <li><a href="/post/python/python%E5%AE%9E%E7%8E%B0%E8%81%8A%E5%A4%A9%E8%BD%B0%E7%82%B8%E6%9C%BA%E5%99%A8%E4%BA%BA/">Python实现聊天轰炸机器人</a></li>
        
        <li><a href="/post/flutter_widget/%E6%8E%A2%E7%B4%A2Flutter_Image%E6%98%BE%E7%A4%BAWebp%E9%80%BB%E8%BE%91/">探索Flutter_Image显示Webp逻辑</a></li>
        
        <li><a href="/flutter%E5%BC%80%E5%8F%91tips1md/">flutter开发tips1</a></li>
        
        <li><a href="/post/Flutter/%E5%9C%A8Flutter%E5%92%8CandroidStudio%E4%B8%AD%E5%88%B6%E4%BD%9C%E7%99%BB%E5%BD%95%E8%A1%A8%E5%8D%95/">《在Flutter和androidStudio中制作登录表单》</a></li>
        
        <li><a href="/post/Flutter/Flutter%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99%E7%95%8C%E9%9D%A2%E5%BA%94%E7%94%A8/">《Flutter个人资料界面应用》</a></li>
        
    </ul>
</div>


        <div class="post-meta meta-tags">
            
            <ul class="clearfix">
                
                <li><a href='/tags/flutter'>flutter</a></li>
                
            </ul>
            
        </div>
    </article>
    
    

    
    
    <div class="post bg-white">
      <script src="https://utteranc.es/client.js"
            repo= "https://github.com/ITmxs/repo"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
      </script>
    </div>
    
</div>

                    <footer id="footer">
    <div>
        &copy; 2021 <a href="https://luckly.work/">早起的年轻人 By luckly</a>
        
        | <a rel="nofollow" target="_blank" href="http://beian.miit.gov.cn/">粤ICP备2021号-1</a>
        
    </div>
    <br />
    <div>
        <div class="github-badge">
            <a href="https://juejin.cn/user/3843548384077192" target="_black" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">掘金</span></a>
        </div>
        <div class="github-badge">
            <a href="https://space.bilibili.com/480883651" target="_black"><span class="badge-subject">Design by</span><span class="badge-value bg-brightgreen">早起的年轻人</span></a>
        </div>
        <div class="github-badge">
            <a href="https://cloud.tencent.com/developer/user/6702670" target="_black"><span class="badge-subject">Theme</span><span class="badge-value bg-yellowgreen">云社区</span></a>
        </div>
    </div>
</footer>


    
    <script type="text/javascript">
        window.MathJax = {
            tex2jax: {
                inlineMath: [['$', '$']],
                processEscapes: true
                }
            };
    </script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script><script src="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src='/js/totop.js?v=0.0.0' async=""></script>



    <script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




    <script src='/js/douban.js'></script>
    <script src="/js/copy-to-clipboard.js"></script>

                </div>

                <div id="secondary">
    <section class="widget">
        <form id="search" action='https://luckly.work/search/' method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="https://luckly.work/">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>
    
    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="https://luckly.work/post/nginx/nginx%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9/" title="Nginx文件内容">Nginx文件内容</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/nginx/nginx%E6%9E%81%E7%AE%80%E6%95%99%E7%A8%8B/" title="Nginx极简教程">Nginx极简教程</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/nginx/%E5%8D%81%E5%88%86%E9%92%9F%E5%85%A5%E9%97%A8nginx/" title="十分钟入门Nginx">十分钟入门Nginx</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/go/Goland%E8%BF%9C%E7%A8%8B%E5%BC%80%E5%8F%91%E9%85%8D%E7%BD%AE/" title="Goland远程开发配置">Goland远程开发配置</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/%E8%AF%BB%E4%B9%A6/%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90/" title="域名解析">域名解析</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/git/%E6%8F%90%E4%BA%A4%E8%BF%87%E7%A8%8B%E7%9C%81%E7%95%A5%E6%9F%90%E4%BA%9B%E6%96%87%E4%BB%B6/" title="提交过程省略某些文件">提交过程省略某些文件</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter_DropdownButton%E7%A4%BA%E4%BE%8B/" title="Flutter_DropdownButton示例">Flutter_DropdownButton示例</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter_ExpansionPanelList%E5%92%8CExpansionPanelList.radio%E7%A4%BA%E4%BE%8B/" title="Flutter_ExpansionPanelList和ExpansionPanelList">Flutter_ExpansionPanelList和ExpansionPanelList</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter%E5%BE%AE%E4%BF%A1%E5%88%86%E4%BA%AB%E9%93%BE%E6%8E%A5%E8%B7%B3%E5%9B%9EApp%E6%8C%87%E5%AE%9A%E9%A1%B5%E9%9D%A2/" title="Flutter微信分享链接跳回App指定页面">Flutter微信分享链接跳回App指定页面</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F/%E5%A4%96%E5%8C%85%E5%8F%AF%E8%83%BD%E7%9A%84%E9%97%AE%E9%A2%98/" title="外包可能的问题">外包可能的问题</a>
    </li>
    
</ul>
    </section>

    

    <section class="widget">
        <h3 class="widget-title"><a href='/categories/'>分类</a></h3>
<ul class="widget-list">
    
    <li><a href="https://luckly.work/categories/Flutter/">Flutter (326)</a></li>
    
    <li><a href="https://luckly.work/categories/IT/">IT (2)</a></li>
    
    <li><a href="https://luckly.work/categories/Kotlin/">Kotlin (2)</a></li>
    
    <li><a href="https://luckly.work/categories/Mysql/">Mysql (1)</a></li>
    
    <li><a href="https://luckly.work/categories/nginx/">nginx (1)</a></li>
    
    <li><a href="https://luckly.work/categories/Vue/">Vue (6)</a></li>
    
    <li><a href="https://luckly.work/categories/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/android/">android (6)</a></li>
    
    <li><a href="https://luckly.work/categories/dart/">dart (96)</a></li>
    
    <li><a href="https://luckly.work/categories/Flutter/">Flutter (28)</a></li>
    
    <li><a href="https://luckly.work/categories/gin/">gin (25)</a></li>
    
    <li><a href="https://luckly.work/categories/git/">git (4)</a></li>
    
    <li><a href="https://luckly.work/categories/Go/">Go (102)</a></li>
    
    <li><a href="https://luckly.work/categories/gorm/">gorm (4)</a></li>
    
    <li><a href="https://luckly.work/categories/grpc/">grpc (1)</a></li>
    
    <li><a href="https://luckly.work/categories/html/">html (3)</a></li>
    
    <li><a href="https://luckly.work/categories/ios/">ios (1)</a></li>
    
    <li><a href="https://luckly.work/categories/linux/">linux (1)</a></li>
    
    <li><a href="https://luckly.work/categories/nginx/">nginx (6)</a></li>
    
    <li><a href="https://luckly.work/categories/python/">python (35)</a></li>
    
    <li><a href="https://luckly.work/categories/read/">读书笔记 (6)</a></li>
    
    <li><a href="https://luckly.work/categories/redis/">redis (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E5%8D%95/">书单 (8)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E8%AF%84/">书评 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师 (19)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师 (25)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E5%88%99/">原则 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%9F%BA%E7%A1%80/">基础 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%BF%83%E8%AF%AD/">心语 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%8F%92%E4%BB%B6/">插件 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%95%99%E5%AD%A6/">教学 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%B2%BE%E8%BF%9B/">精进 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%BC%96%E7%A8%8B/">编程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%99%9A%E5%B9%BB/">虚幻 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%91%E6%AD%A5/">跑步 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%BA%BF/">路线 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%A1%B9%E7%9B%AE/">项目 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%AD%85%E5%8A%9B/">魅力 (1)</a></li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title"><a href='/tags/'>标签</a></h3>
<div class="tagcloud">
    
    <a href="https://luckly.work/tags/flutter/">flutter</a>
    
    <a href="https://luckly.work/tags/IT/">IT</a>
    
    <a href="https://luckly.work/tags/Kotlin/">Kotlin</a>
    
    <a href="https://luckly.work/tags/Mysql/">Mysql</a>
    
    <a href="https://luckly.work/tags/nginx/">nginx</a>
    
    <a href="https://luckly.work/tags/Vue/">Vue</a>
    
    <a href="https://luckly.work/tags/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载</a>
    
    <a href="https://luckly.work/tags/android/">android</a>
    
    <a href="https://luckly.work/tags/dart/">dart</a>
    
    <a href="https://luckly.work/tags/flutter/">flutter</a>
    
    <a href="https://luckly.work/tags/gin/">gin</a>
    
    <a href="https://luckly.work/tags/git/">git</a>
    
    <a href="https://luckly.work/tags/go/">go</a>
    
    <a href="https://luckly.work/tags/gorm/">gorm</a>
    
    <a href="https://luckly.work/tags/grpc/">grpc</a>
    
    <a href="https://luckly.work/tags/html/">html</a>
    
    <a href="https://luckly.work/tags/ios/">ios</a>
    
    <a href="https://luckly.work/tags/linux/">linux</a>
    
    <a href="https://luckly.work/tags/nginx/">nginx</a>
    
    <a href="https://luckly.work/tags/python/">python</a>
    
    <a href="https://luckly.work/tags/redis/">redis</a>
    
    <a href="https://luckly.work/tags/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E5%8D%95/">书单</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E8%AF%84/">书评</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师</a>
    
    <a href="https://luckly.work/tags/%E5%85%A5%E9%97%A8/">入门</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E5%88%99/">原则</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯</a>
    
    <a href="https://luckly.work/tags/%E5%9F%BA%E7%A1%80/">基础</a>
    
    <a href="https://luckly.work/tags/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应</a>
    
    <a href="https://luckly.work/tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
    
    <a href="https://luckly.work/tags/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路</a>
    
    <a href="https://luckly.work/tags/%E5%BF%83%E8%AF%AD/">心语</a>
    
    <a href="https://luckly.work/tags/%E6%8F%92%E4%BB%B6/">插件</a>
    
    <a href="https://luckly.work/tags/%E6%95%99%E5%AD%A6/">教学</a>
    
    <a href="https://luckly.work/tags/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明</a>
    
    <a href="https://luckly.work/tags/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书</a>
    
    <a href="https://luckly.work/tags/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单</a>
    
    <a href="https://luckly.work/tags/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫</a>
    
    <a href="https://luckly.work/tags/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸</a>
    
    <a href="https://luckly.work/tags/%E7%B2%BE%E8%BF%9B/">精进</a>
    
    <a href="https://luckly.work/tags/%E7%BC%96%E7%A8%8B/">编程</a>
    
    <a href="https://luckly.work/tags/%E8%99%9A%E5%B9%BB/">虚幻</a>
    
    <a href="https://luckly.work/tags/%E8%AF%97/">诗</a>
    
    <a href="https://luckly.work/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
    
    <a href="https://luckly.work/tags/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路</a>
    
    <a href="https://luckly.work/tags/%E8%B7%91%E6%AD%A5/">跑步</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%BA%BF/">路线</a>
    
    <a href="https://luckly.work/tags/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施</a>
    
    <a href="https://luckly.work/tags/%E9%80%9A%E8%AE%AF%E5%BD%95/">通讯录</a>
    
    <a href="https://luckly.work/tags/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学</a>
    
    <a href="https://luckly.work/tags/%E9%A1%B9%E7%9B%AE/">项目</a>
    
    <a href="https://luckly.work/tags/%E9%AD%85%E5%8A%9B/">魅力</a>
    
</div>
    </section>

    
<section class="widget">
    <h3 class="widget-title">友情链接</h3>
    <ul class="widget-list">
        
        <li>
            <a target="_blank" href="http://www.topgoer.com/" title="枯藤">枯藤</a>
        </li>
        
        <li>
            <a target="_blank" href="https://gorm.cn/zh_CN/docs/index.html" title="gorm">gorm</a>
        </li>
        
        <li>
            <a target="_blank" href="https://docs.python.org/zh-cn/3/tutorial/index.html" title="python">python</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.liwenzhou.com/" title="李文周">李文周的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://www.xbzweb.com/" title="小包子的博客">小包子的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.flysnow.org/" title="飞雪无情的博客">飞雪无情的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="https://sliverhorn.com/" title="sliverhorn的博客">sliverhorn的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://yuedu.baidu.com/ebook/14a722970740be1e640e9a3e" title="Android Gradle权威指南">Android Gradle权威指南</a>
        </li>
        
        <li>
            <a target="_blank" href="https://gesdh.cn/" title="小格子">格子导航</a>
        </li>
        
        <li>
            <a target="_blank" href="https://itachi.xyz/" title="阿林">itachi&#39;s Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="https://darjun.github.io/" title="大俊">大俊Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="https://geektutu.com/post/quick-golang.html" title="极客兔兔">极客兔兔Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="http://zxfcumtcs.github.io/" title="赵雪峰">雪峰Blog</a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="https://luckly.work/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
            </div>
        </div>
    </div>
</body>

</html>